package com.yantong.mapper;

import com.yantong.pojo.Achieve;
import com.yantong.pojo.AchieveFlow;
import com.yantong.pojo.AchieveFlowExample;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author kanghaixin
 */
public interface AchieveFlowMapper {
    /**
     * 条件统计
     * @param example
     * @return
     */
    int countByExample(AchieveFlowExample example);

    /**
     * 条件删除
     * @param example
     * @return
     */
    int deleteByExample(AchieveFlowExample example);

    /**
     * 主键删除
     * @param id
     * @return
     */
    int deleteByPrimaryKey(Long id);

    /**
     * 全字段插入
     * @param record
     * @return
     */
    int insert(AchieveFlow record);

    /**
     * 适配插入
     * @param record
     * @return
     */
    int insertSelective(AchieveFlow record);

    /**
     * 条件查询
     * @param example
     * @return
     */
    List<AchieveFlow> selectByExample(AchieveFlowExample example);
    
    /**
     * 详情
     * @param id
     * @return
     */
    AchieveFlow selectByPrimaryKey(Long id);

    /**
     * 适配条件更新
     * @param record
     * @param example
     * @return
     */
    int updateByExampleSelective(@Param("record") AchieveFlow record, @Param("example") AchieveFlowExample example);

    /**
     * 适配主键更新
     * @param record
     * @return
     */
    int updateByPrimaryKeySelective(AchieveFlow record);

    /***
     * 条件统计
     * @param params
     * @return
     */
    int countByParams(Map<String, Object> params);

    /**
     * 条件查询
     * @param params
     * @param rowBounds
     * @return
     */
    List<AchieveFlow> listByParams(Map<String, Object> params, RowBounds rowBounds);

    /**
     * 条件查询-不分页
     * @param params
     * @return
     */
    List<AchieveFlow> listByParams(Map<String, Object> params);

    /**
     * 批量插入
     * @param list
     * @param achieveDate
     * @return
     */
    int batchInsert(@Param("list") List<AchieveFlow> list, @Param("achieveDate") Date achieveDate);

    /**
     * 条件统计月份业绩
     * @param params
     * @param rowBounds
     * @return
     */
    List<Achieve> countAchieve(Map<String, Object> params, RowBounds rowBounds);
}